package com.lft.examsys.service;

import com.lft.examsys.entity.Permission;
import com.lft.examsys.mapper.PermissionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PermissionService {
    @Autowired
    private PermissionMapper permissionMapper;


    public List<Permission> getAllPermission() {
        return permissionMapper.getAllPermission();
    }

    public List<String> getActivePermissionIdByRoleId(String id) {
        return permissionMapper.getActivePermissionIdByRoleId(id);
    }

    public boolean AddPermission(String role, String permission) {
        return permissionMapper.addPermission(role, permission);
    }

    public boolean RemovePermission(String role, String permission) {
        return permissionMapper.removePermission(role, permission);
    }

    public List<String> getAllPermissionName() {
        return permissionMapper.getAllPermissionName();
    }
}
